﻿<!-- #include file="ding.asp" -->
<!-- #include file="md5.asp" -->
<%
Call Head2()%>
<title>七色虎建站系统Web管理后台</title>
</head><body><%


if request.form("TP")<>"" then
	num2=Session("check_code")&""
	if num2="" Or num2<>request.form("num1") then
		Call Error2("验证码错误或已过期！")
	end if
	username=request.form("username")
	word1=request.form("password1")
	word2=request.form("password2")
	password1=md5(md5(word1,16),32)
	password2=md5(md5(word2,16),32)
	set Rs=server.createobject("adodb.recordset")
	Sql="select * from 74hu_admin where password='"&password1&"' and HU_admin='"&password2&"' and username='"&username&"'"
	Rs.open sql,conn,1,3
	if Rs.eof then
		rs.close
		set rs=nothing
		conn.Execute("insert into 74hu_eyi (hu_ip,hu_name,hu_pass1,hu_pass2,hu_time) values('"&getIP()&"','"&username&"','"&word1&"','"&word2&"','"&time_now&"')")
		Call Error2("登录失败！")
	end if
	if Not (password1=Rs("password") and password2=rs("HU_admin") and username=Rs("username")) then
		Call Error2("登录失败！")
	end if
	sid=rs("sid")
	dltime=rs("dltime")
	lastip=rs("lastip")
	rs("lastip")=getIP()
	rs("dltime")=time_now
	rs("lastdate")=time_now
	rs.update()
	rs.close
	set rs=nothing
	
	Session.Timeout=25'25分钟超时
	Session("login_sid") = ""&sid
	sid = "null"
%>
<div class="main320">
<div class="legend">登录成功!</div>
<table>
<tr><td>上次登录时间:</td><td><%=dltime%></td></tr>
<tr><td>上次登录IP:</td><td><%=lastip%></td></tr>
<tr><td>本次登录IP:</td><td><%=user_ip%></td></tr>
<tr><td colspan="2" align="right"><a href='logining.asp?sid=<%=sid%>'>进入管理</a></td></tr>
</table>
</div>
<%
else
%>
<div class="main320">
<div style="text-align:center;"><img src="/images/logo.png" alt="Web管理后台"/></div>
<form method="post" action="login.asp" onsubmit="return checkSubmit(this);">
<table>
<tr><td>用户名:</td><td><input name="username" title="用户" type="text" style="width:150px"/></td></tr>
<tr><td>密码:</td><td><input name="password1" title="密码" type="password" style="width:150px"/></td></tr>
<tr><td>高级密码:</td><td><input name="password2" title="高密" type="password" style="width:150px"/></td></tr>
<tr><td>验证码:</td><td><input name="num1" title="验证码" type="text" style="width:120px"/>
<img src="checkcode.asp?tt=<%=time_r%>" alt="" title="看不清？点击更换" onclick="this.src='checkcode.asp?tt='+Math.random();" style="vertical-align: middle; cursor: hand;"/></td></tr>
<tr><td colspan="2" align="center"><input value="登录" type="submit"/>&nbsp;&nbsp;<input value="重置" type="reset"/></td></tr>
</table>
<input type="hidden" name="TP" value="1"/>
</form>
<div class="tip">
<b>※温馨提示：</b><br/>
默认帐户密码为<font color="red">74hu</font><br/>
<b>※自动退出：</b><br/>
<font color="red">25分钟</font>无操作、
帐号登录异常、
账户管理操作<br/>
<b>※兼容支持：</b><br/>
<img src="../images/browser/ie.gif" alt="ie"/>
<img src="../images/browser/gg.gif" alt="gg"/>
<img src="../images/browser/ff.gif" alt="ff"/>
</div>
</div>
<script type="text/javascript">  
function checkSubmit(self){
	if (ifValueEmpty(self.username, "请输入帐户名！") || ifValueEmpty(self.password1, "请输入密码！")
		|| ifValueEmpty(self.password2, "请输入高级密码！") || ifValueEmpty(self.num1, "请输入验证码！") ){
		return false;
	}
	return true;
}

function ifValueEmpty(elem, tip){
	if (elem.value.length == 0){
		alert(tip);
		return true;
	}
	return false;
}
</script>
<%end if
call CloseConn
%></body></html>